package com.hubei.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;

@ApiModel(value="用户券")
@Data
@Accessors(chain = true) //开启链写编程
@TableName(value = "ms_member_coupon")
public class MsMemberCoupon {

    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value="用户券id")
    private Long id;

    @TableField(value = "openid")
    @ApiModelProperty(value=" 微信openid")
    private String openid;

    @TableField(value = "couponid")
    @ApiModelProperty(value="券id")
    private Long couponid;

    @TableField("enumtype")
    @ApiModelProperty(value = "枚举类型(数值)",example = "券枚举  0 优惠券 1 团购券 2礼品券")
    private Integer enumtype;

    @TableField(exist = false)
    @ApiModelProperty(value = "枚举类型(字符串)",example = "券枚举  0 优惠券 1 团购券 2礼品券", hidden = true)
    private String enumtypeString;

    @TableField("price")
    @ApiModelProperty(value = "券抵扣金额")
    private BigDecimal price;

    @TableField(value = "`condition`")
    @ApiModelProperty(value="使用条件",example = "只能用于小型货车")
    private String condition;

    @TableField(value = "begindate")
    @ApiModelProperty(value="开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd",  timezone="GMT+8")
    private LocalDateTime begindate;

    @TableField(value = "enddate")
    @ApiModelProperty(value="结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd",  timezone="GMT+8")
    private LocalDateTime enddate;

    @TableField(value = "isuse")
    @ApiModelProperty(value="是否使用")
    private Boolean isuse;

    @TableField(value = "isstop")
    @ApiModelProperty(value="是否禁用")
    private Boolean isstop;

    @TableField(value = "createdate")
    @ApiModelProperty(value="领取日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",  timezone="GMT+8")
    private Timestamp createdate;

    @TableField(value = "loginid")
    @ApiModelProperty(value="审核人id")
    private Long loginid;

    @TableField(value = "loginname")
    @ApiModelProperty(value="审核人名称")
    private String loginname;

    @TableField(value = "usedatetime")
    @ApiModelProperty(value="核销时间", example = "2019-11-29 16:14:33")
    private LocalDateTime usedatetime;

}
